package com.clss.commandhelper.tools.janus.util;

import android.os.SystemClock;
import android.widget.Chronometer;

public class ChronometerUtils {
	private Chronometer mediaTime;

	public Chronometer getMediaTime() {
		return mediaTime;
	}
	public void setMediaTime(Chronometer mediaTime) {
		this.mediaTime = mediaTime;
	}
	public void setStartChronometer(){
		if(mediaTime==null){
			return;
		}
		// 将计时器清零  
		setStartChronometer(SystemClock.elapsedRealtime());
	}
	public void setStartChronometer(long baseTime){
		if(mediaTime==null){
			return;
		}
		// 将计时器设置为时间
		mediaTime.setBase(baseTime);
        //开始计时  
		mediaTime.start();
	}
	public void setStopChronometer(){
		if(mediaTime==null){
			return;
		}
		//停止计时  
		mediaTime.stop(); 
	}
}
